{extend name="common/base" /}
{block name="title"}软件搜索{/block}
{block name="head"}
<link rel="stylesheet" href="/public/static/css/github-markdown.css">
{/block}
{block name="body"}
<div class="container" style="margin-top: 65px;">
    <nav aria-label="breadcrumb">
        <ol class="breadcrumb">
            <li class="breadcrumb-item"><a href="{:url('Index/index')}">首页</a></li>
            <li class="breadcrumb-item">软件搜索</li>
        </ol>
    </nav>
    <form method="get">
        <div class="input-group">
            <input class="form-control form-control-lg" value="{$data['keywords']}" name="keywords" type="search" placeholder="请输入搜索关键字" aria-label="Search" required>
            <button class="btn btn-outline-success btn-lg" type="submit" formaction="{:url('Search/software', [])}">搜软件</button>
            <button class="btn btn-outline-success btn-lg" type="submit" formaction="{:url('Search/article', [])}">搜文章</button>
        </div>
    </form>
    <hr/>
    <ul class="nav nav-tabs justify-content-center">
        <li class="nav-item">
            <a class="nav-link active" href="{:url('Search/software', ['keywords' => $data['keywords']])}">
                软件
                <span class="badge bg-success">{$softwareCount}</span>
            </a>
        </li>
        <li class="nav-item">
            <a class="nav-link" href="{:url('Search/article', ['keywords' => $data['keywords']])}">
                文章
                <span class="badge bg-success">{$articleCount}</span>
            </a>
        </li>
    </ul>
    <div class="list-group list-group-flush">
        {foreach $result as $res}
        <a href="{:url('Software/info', ['id' => $res->id])}" target="_blank" class="list-group-item list-group-item-action">
            <div class="d-flex w-100 justify-content-between">
                <h5 class="mb-1">{$res.name|raw}</h5>
                <small class="text-muted">{$res.create_time}</small>
            </div>
            <p class="mb-1">{$res.remark|raw}</p>
            <small class="text-muted">{$res.category.title}</small>
        </a>
        {/foreach}
    </div>
    <div class="mt-3">
        {$result->render()|raw}
    </div>
    <div class="mt-3 border">
        <ins class="adsbygoogle" style="display:block; text-align:center;" data-ad-layout="in-article" data-ad-format="fluid" data-ad-client="ca-pub-8372518057241672" data-ad-slot="1313079536"></ins>
    </div>
</div>
{/block}
{block name="script"}
{/block}